package Test.com;

import com.sun.deploy.security.SelectableSecurityManager;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author げっしょく
 * @date 2021/7/12
 */
public class test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<String> list = new ArrayList<>();
        String s ;
        int i = 1;
        while(true){
            System.out.println("请输入第"+i+"个字符串：");
            s = sc.next();
            i++;
            if("end".equals(s)){
                break;
            }
            list.add(s);
        }
        if(list.size() >= 2){
            for (i = 0; i < list.size(); i++) {
                s = list.get(i);
                System.out.println(s);
            }
        }else
            System.out.println("集合中的字符串个数不足两个，不输出");
    }
}

